import React, { Component } from "react";

class View extends Component {
  constructor(props) {
    super(props);
    this.state = {};
  }
  toActive(id) {
    if (id == 1) {
      this.props.history.push("/activedetails");
    } else {
      this.props.history.push("/gcmsg");
    }
    // console.log(5555);
  }

  toDetail() {
    this.props.history.push("/talk");
  }
  render() {
    return (
      <>
        <div className="msg_div">
          {/* 头部 */}
          <div className="msg_top">
            <p className="msg_title">消息</p>
            <div className="msg_itemize">
              <div onClick={() => this.toActive(1)}>
                <img src={require("./img/activemsg.png").default} alt="" />
                <span>活动消息</span>
              </div>
              <div onClick={() => this.toActive(2)}>
                <img src={require("./img/gcxx.png").default} alt="" />
                <span>广场消息</span>
              </div>
            </div>
          </div>
          {/* 内容区 */}
          <div className="msg_content">
            <div className="msg_content_talk" onClick={() => this.toDetail()}>
              <img src={require("./img/tx.png").default} alt="" />
              <div className="msg_content_msg_div">
                <div className="msg_content_msgdiv">
                  <span className="talkername">阿猫阿狗</span>
                  <span className="msg_success">交易成功</span>
                </div>
                <p className="msg_content_msgxt">
                  [系统]买家确认收货，钱已到账啦！
                </p>
              </div>
            </div>
          </div>
        </div>
      </>
    );
  }
}
export default View;
